<template>
    <div id="addFill">
        <div class="jx-content">
            <el-form :inline="true" class="demo-form-inline clearfix" :model="form">
                <el-form-item label="年份 ：">
                  <el-input-number v-model="form.num8" controls-position="right"  @change="handleChange" :min="2010" :max="2019"></el-input-number>
                </el-form-item>
                <el-form-item label="班级 ：">
                    <el-select v-model="form.chooseClass" placeholder="请选择班级">
                        <el-option
                        v-for="item in form.optionsclass"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value"
                        ></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="状态 ：">
                    <el-select v-model="form.choosestatus" placeholder="请选择状态">
                        <el-option
                        v-for="item in form.optionstatus"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value"
                        ></el-option>
                    </el-select>
                 </el-form-item>
                 <el-form-item label="学生信息 ：">
                     <el-input  v-model="form.info" placeholder="请输入学生信息"></el-input>
                 </el-form-item>
                 <el-form-item >
                    <div class="button-style" @click="search">搜 索</div>
                </el-form-item>
             </el-form>
            <div class="table">
               <el-table :data="tableData" style="width: 100%">
                    <el-table-column  type="index" label="序号" width='100'>
                        <template slot-scope="scope"><span>{{scope.$index+(currentPage - 1) * pagesize + 1}}</span> </template>
                    </el-table-column>
                    <el-table-column prop="classname" label="班级"></el-table-column>
                    <el-table-column prop="class" label="年级" ></el-table-column>
                    <el-table-column prop="number" label="学号"></el-table-column>
                    <el-table-column prop="name" label="姓名"></el-table-column>
                    <el-table-column  label="操作">
                         <template slot-scope="scope">
                            <el-button type="text" size="small"  @click="knotFn(scope.row.id)">查看</el-button>
                         </template>
                    </el-table-column>
                </el-table>
                 <el-pagination
                    @size-change="handleSizeChange"
                    @current-change="handleCurrentChange"
                    :current-page="currentPage"
                    :page-size="pagesize"
                    layout="total, prev, pager, next, jumper"
                    :total="totalCount"
                 ></el-pagination>
            </div>
        </div>
    </div>
</template>

<script>
    export default {
        data () {
            return {
                 form:{
                   num8: 2010,
                   info:'',
                   chooseClass:'',
                   optionsclass:[{
                        value: '选项1',
                        label: '黄金糕1'
                        }, {
                        value: '选项2',
                        label: '双皮奶1'
                        }
                   ],
                   choosestatus:'',
                   optionstatus:[
                       { value: '选项3',
                        label: '黄金糕'
                        }, {
                        value: '选项4',
                        label: '双皮奶'
                        }
                   ],
                },
                currentPage: 1,
                pagesize: 10,
                totalCount: 1000,
                tableData: [{
                    classname: '2016-05-02',
                    class:'大数据',
                    number:'212121212',
                    name: '王小虎'
                    }
                ]
            
            }
        },
        created () {
            
        },
        methods: {
             //搜索
            search(){
              
            },
             //分页
			handleSizeChange: function (size) {
				this.pagesize = size;
			},
			handleCurrentChange: function(currentPage) {
                this.currentPage = currentPage
                //this.init()
            },
            //查看
            knotFn(id){
                this.$router.replace({
                   path:'/',
                   query:{}
                })
            },
            //计数
             handleChange(value) {
                 console.log(value);
            }
        },
    }
</script>
<style scoped>
   .el-input-number.is-controls-right>>>.el-input-number__increase{
        line-height: 16px;
    }
    .el-input-number{
        position: relative;
        display: inline-block;
        line-height: 38px;
        overflow: hidden;
        width: auto;
    }
    .el-input-number>>>.el-input-number__increase{
        top: 4px;
    }
    .el-input-number.is-controls-right>>>.el-input-number__decrease{
         bottom: 4px;
    }
    .el-input-number>>>.el-input .el-input__inner{
        width: 100px;
    } 
    
</style>
<style lang="scss" scoped>
 @import "./../../../styles/layout/color_variables";
 #addFill {
    width: $width;
    margin: 20px auto;
    color: #727272;
    .el-form-item{
             margin-bottom:0px;
         }
        .tips{
            margin-left: 10px;
            color: #1277eb;
        } 
    
 }
</style>